<!DOCTYPE html>
<html>
<head>
    <title>API Response Test</title>
    <meta charset="UTF-8">
</head>
<body>
    <h1>API Response Test</h1>
    <button onclick="testAPI()">Test API</button>
    <pre id="result"></pre>

    <script>
        function testAPI() {
            fetch('https://tqi.techlinkpets3d.com/api/daka/person_rank', {
                method: 'GET',
                headers: {
                    'Content-Type': 'application/json'
                }
            })
            .then(response => {
                console.log('Response status:', response.status);
                console.log('Content type:', response.headers.get('content-type'));
                return response.text(); // 先获取文本内容
            })
            .then(text => {
                console.log('Raw response:', text);
                document.getElementById('result').textContent = text;
                
                // 尝试解析为JSON
                try {
                    const data = JSON.parse(text);
                    console.log('Parsed JSON:', data);
                } catch (e) {
                    console.error('JSON parse error:', e);
                }
            })
            .catch(error => {
                console.error('Fetch error:', error);
            });
        }
    </script>
</body>
</html>